from langdev_helper.prompt.fc import DEFAULT_SYSTEM_TEMPLATE, system_prompt_qwen
from langdev_core.llms.qianfan import call_llm
from langchain_core.tools import tool
from langchain.tools.render import render_text_description
from langchain_core.prompts import PromptTemplate

@tool
def multiply(first_int: int, second_int: int) -> int:
    """将两个整数相乘。"""
    return first_int * second_int

@tool
def add(first_int: int, second_int: int) -> int:
    "将两个整数相加。"
    return first_int + second_int

@tool
def exponentiate(base: int, exponent: int) -> int:
    "对底数求指数幂。"
    return base**exponent

tools = [add, exponentiate, multiply]
rendered_tools = render_text_description(tools)

system_prompt = DEFAULT_SYSTEM_TEMPLATE
# system_prompt = system_prompt_qwen

prompt_template = PromptTemplate.from_template(system_prompt)

sys_pt = prompt_template.format(rendered_tools= rendered_tools)

call_llm("3加3等于", sys_pt)
